import {createApp} from 'vue'
import App from './App.vue'
import router from '@/router';
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import './assets/styles/element/index.scss'
import VueI18n from "./i18n";
import store from "@/store";
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
//导入进度条插件
import NProgress from 'nprogress'
import 'nprogress/nprogress.css'

//全局进度条的配置
NProgress.configure({
    showSpinner: false,  //加载微调器设置,默认为true
    //使用缓动（CSS缓动字符串）和速度（以毫秒为单位）调整动画设置。（默认：ease和200）
    // easing: 'ease',
    // speed: 2000,
    // minimum: 0,  //更改启动时使用的最小百分比
})

//对路由钩子函数进行设置
//路由进入前
router.beforeEach((to, from, next) => {
    NProgress.start();
    next();
});
//路由进入后
router.afterEach(() => {
    NProgress.done()
})

const app = createApp(App)
app.use(store)
app.use(router);
app.use(ElementPlus)
app.use(VueI18n)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}
app.mount('#app')
